home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Apple WWDC 1996
/
WWDC96_1996 (CD).toast
/
Technology Materials
/
MacOS 8 Resources
/
Developer Tools
/
Mac OS 8 Interfaces & Libraries
/
Interfaces
/
AIncludes
/
TextObjects.a
< prev
next >
Wrap
Text File
|
1996-05-01
|
9KB
|
295 lines
;
; File: TextObjects.a
;
; Contains: Text object Interfaces.
;
; Version: Technology: System 8
; Release: Universal Interfaces 3.0d3 on Copland DR1
;
; Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
;
; Bugs?: If you find a problem with this file, send the file and version
; information (from above) and the problem description to:
;
; Internet: apple.bugs@applelink.apple.com
; AppleLink: APPLE.BUGS
;
;
IF &TYPE('__TEXTOBJECTS__') = 'UNDEFINED' THEN
__TEXTOBJECTS__ SET 1
IF &TYPE('__CONDITIONALMACROS__') = 'UNDEFINED' THEN
include 'ConditionalMacros.a'
ENDIF
IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
include 'Types.a'
ENDIF
IF &TYPE('__UNICODE__') = 'UNDEFINED' THEN
include 'Unicode.a'
ENDIF
IF &TYPE('__TEXTCOMMON__') = 'UNDEFINED' THEN
include 'TextCommon.a'
ENDIF
IF FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE THEN
; Basic data types
; typedef UInt32 TextObjectUnit
; typedef TextObjectUnit * TextObject
; typedef TextObject * TextObjectPtr
; typedef const TextObjectUnit * ConstTextObject
; Indices into text objects
; typedef UInt32 TextObjectIndex
kTextObjectStart EQU 0
kTextObjectEnd EQU $FFFFFFFF
; Option flags
; typedef OptionBits TextObjectOptions
;
; The default or standard OptionBits are all zero by convention. The following
; symbolic constant is provided for code readability.
;
kTextObjStandardOptions EQU 0
kTextObjNormalizeOptBit EQU 0
kTextObjDontNormalizeOpt EQU $00
kTextObjNormalizeOpt EQU $01
; Creation and destruction
;
; extern OSStatus NewTextObject(TextObject *newTextObject)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION NewTextObject
ENDIF
;
; extern OSStatus InitPersistentTextObject(TextObjectUnit textObjectSpace[2147483647], ByteCount sizeInBytes)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION InitPersistentTextObject
ENDIF
;
; extern OSStatus DisposeTextObject(TextObject textObject)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION DisposeTextObject
ENDIF
;
; extern OSStatus CreateTextObjectFromTextObject(ConstTextObject oldTextObject, TextObjectIndex startIndex, TextObjectIndex endIndex, TextObject *newTextObject, TextObjectOptions optionBits)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION CreateTextObjectFromTextObject
ENDIF
; Text content manipulation
;
; extern OSStatus InstallTextIntoTextObject(const char *srcText, ByteCount srcLengthInBytes, TextEncoding srcEncoding, LocaleIdentifier language, TextObject destTextObject, TextObjectOptions optionBits)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION InstallTextIntoTextObject
ENDIF
;
; extern OSStatus AppendTextToTextObject(const char *srcText, ByteCount srcLengthInBytes, TextEncoding srcEncoding, LocaleIdentifier language, TextObject destTextObject, TextObjectOptions optionBits)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION AppendTextToTextObject
ENDIF
;
; extern OSStatus ExtractTextFromTextObject(ConstTextObject textObject, TextObjectIndex startIndex, TextObjectIndex endIndex, char *destText, ByteCount destMaxSizeInBytes, TextEncoding destEncoding, LocaleIdentifier *language, ByteCount *destSizeInBytes, TextObjectIndex *nextSrcIndex)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION ExtractTextFromTextObject
ENDIF
;
; extern OSStatus ReplaceInTextObject(TextObject destText, TextObjectIndex destStartIndex, TextObjectIndex destEndIndex, ConstTextObject srcText, TextObjectIndex srcStartIndex, TextObjectIndex srcEndIndex, TextObjectIndex *newStartIndex, TextObjectIndex *newEndIndex)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION ReplaceInTextObject
ENDIF
; Text object information
;
; extern Boolean IsPersistentTextObject(ConstTextObject textObject)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION IsPersistentTextObject
ENDIF
;
; extern Boolean IsTextObjectEmpty(ConstTextObject textObject)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION IsTextObjectEmpty
ENDIF
;
; extern ByteCount GetTextObjectSize(ConstTextObject textObject)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION GetTextObjectSize
ENDIF
;
; extern ByteCount GetTextObjectMaxSize(ConstTextObject textObject)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION GetTextObjectMaxSize
ENDIF
;
; extern TextObjectIndex GetTextObjectEndIndex(ConstTextObject textObject)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION GetTextObjectEndIndex
ENDIF
;
; extern ByteCount ComputePersistentTextObjectSize(ConstTextObject textObject, TextObjectIndex startIndex, TextObjectIndex endIndex, TextObjectOptions optionBits)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION ComputePersistentTextObjectSize
ENDIF
;
; extern ByteCount ComputePersistentTextObjectFromTextSize(const char *text, ByteCount textByteLength, TextEncoding textEncoding, LocaleIdentifier language, TextObjectOptions optionBits)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION ComputePersistentTextObjectFromTextSize
ENDIF
;
; extern OSStatus ComputeTextObjectExtractedTextSize(ConstTextObject textObject, TextObjectIndex startIndex, TextObjectIndex endIndex, ByteCount destMaxSizeInBytes, TextEncoding destEncoding, LocaleIdentifier *language, ByteCount *destResultLengthInBytes, TextObjectIndex *nextSrcIndex)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION ComputeTextObjectExtractedTextSize
ENDIF
;
; extern OSStatus GetTextObjectTextTags(ConstTextObject textObject, TextObjectIndex index, TextEncoding *encoding, LocaleIdentifier *language)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION GetTextObjectTextTags
ENDIF
; This is equivalent to the preceding function. The preceding name is preferred.
;
; extern OSStatus GetTextObjectEncodingAndLocaleIdentifier(ConstTextObject textObject, TextObjectIndex index, TextEncoding *encoding, LocaleIdentifier *language)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION GetTextObjectEncodingAndLocaleIdentifier
ENDIF
; Bulk access to text content
TextObjectTextInfo RECORD 0
encoding ds.l 1 ; offset: $0 (0)
language ds.l 1 ; offset: $4 (4)
startIndex ds.l 1 ; offset: $8 (8)
endIndex ds.l 1 ; offset: $C (12)
textLength ds.l 1 ; offset: $10 (16)
text ds.l 1 ; offset: $14 (20)
sizeof EQU * ; size: $18 (24)
ENDR
;
; extern OSStatus CountTextObjectTextRuns(ConstTextObject textObject, TextObjectIndex startIndex, TextObjectIndex endIndex, ItemCount *numTextRuns)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION CountTextObjectTextRuns
ENDIF
;
; extern OSStatus GetTextObjectTextRuns(ConstTextObject textObject, TextObjectIndex startIndex, TextObjectIndex endIndex, ItemCount runArraySize, TextObjectTextInfo runInfo[2147483647], ItemCount *actualNumTextRuns)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION GetTextObjectTextRuns
ENDIF
; Comparison functions are in TextUtils
; Annotations
; Annotation types are given by the traditional four-character codes
; typedef FourCharCode TextObjectAnnotationTag
; A wildcard tag to specify all annotations
kTextObjAnyAnnotationType EQU '****'
; Annotation attributes
; typedef OptionBits TextObjectAnnotationAttributes
; Annotation attribute bits
kTextObjAnnotationChangedMask EQU $01
kTextObjTextChangedMask EQU $02
;
; extern OSStatus AnnotateTextObject(TextObject textObject, TextObjectIndex startIndex, TextObjectIndex endIndex, TextObjectAnnotationTag annotationType, ByteCount dataLength, const void *data, TextObjectAnnotationAttributes annotationOptions)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION AnnotateTextObject
ENDIF
;
; extern OSStatus DeleteTextObjectAnnotations(TextObject textObject, TextObjectIndex startIndex, TextObjectIndex endIndex, TextObjectAnnotationTag annotationType)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION DeleteTextObjectAnnotations
ENDIF
; Accessing annotations
TextObjectAnnotationInfo RECORD 0
annotationType ds.l 1 ; offset: $0 (0)
rangeStart ds.l 1 ; offset: $4 (4)
rangeEnd ds.l 1 ; offset: $8 (8)
attributes ds.l 1 ; offset: $C (12)
dataSize ds.l 1 ; offset: $10 (16)
data ds.l 1 ; offset: $14 (20)
sizeof EQU * ; size: $18 (24)
ENDR
;
; extern OSStatus CountTextObjectAnnotations(ConstTextObject textObject, TextObjectIndex startIndex, TextObjectIndex endIndex, TextObjectAnnotationTag annotationType, ItemCount *numAnnotations)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION CountTextObjectAnnotations
ENDIF
;
; extern OSStatus GetTextObjectAnnotations(ConstTextObject textObject, TextObjectIndex startIndex, TextObjectIndex endIndex, TextObjectAnnotationTag annotationType, ItemCount infoArraySize, TextObjectAnnotationInfo annotationInfo[2147483647], ItemCount *actualNumAnnotations)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION GetTextObjectAnnotations
ENDIF
;
; extern OSStatus SetAnnotationAttributes(TextObject textObject, TextObjectIndex startIndex, TextObjectIndex endIndex, TextObjectAnnotationTag annotationType, TextObjectAnnotationAttributes annotationOptions)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION SetAnnotationAttributes
ENDIF
; Miscellaneous
;
; extern OSStatus VerifyTextObject(ConstTextObject textObject)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION VerifyTextObject
ENDIF
;
; extern OSStatus NormalizeTextObject(TextObject textObject)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION NormalizeTextObject
ENDIF
ENDIF
ENDIF ; __TEXTOBJECTS__